package com.example.entity;

import javax.persistence.*;
import java.sql.Time;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "DEPTMENT", schema = "TEST", catalog = "")
public class DeptmentEntity {
    private String deptId;
    private String deptName;
    private Date createTime;
    private String deptDesc;

    @Id
    @Column(name = "DEPT_ID", nullable = false, length = 32)
    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    @Basic
    @Column(name = "DEPT_NAME", nullable = true, length = 20)
    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    @Basic
    @Column(name = "CREATE_TIME", nullable = true)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Time createTime) {
        this.createTime = createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "DEPT_DESC", nullable = true, length = 20)
    public String getDeptDesc() {
        return deptDesc;
    }

    public void setDeptDesc(String deptDesc) {
        this.deptDesc = deptDesc;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DeptmentEntity that = (DeptmentEntity) o;
        return Objects.equals(deptId, that.deptId) &&
                Objects.equals(deptName, that.deptName) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(deptDesc, that.deptDesc);
    }

    @Override
    public int hashCode() {
        return Objects.hash(deptId, deptName, createTime, deptDesc);
    }
}
